<?php

namespace app\admin\service;
use app\model\SetSystem;
use think\facade\Cache;

class SetService
{

    public function getSetSystem(): array
    {

        $arr = Cache::get('system_valid');
        if (!$arr){
            $sys = SetSystem::field("key,value")->select();
            $arr = array();
            foreach ($sys as $v){
                $arr[$v->getAttr('key')] = $v->getAttr('value');
            }
            // 加入缓存
            Cache::tag('set_system')->set('system_valid', $arr);
        }

        return $arr;

    }


}
